<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="转包单" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列" ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <!-- <div class="btn btn-default base-color">
                            <div translate translate-attr-title="导出" yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div> -->
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="转包单号" ng-model="condition.codeLike">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>订单号码</span>：</label>
                        <input type="text" class="form-control"  translate translate-attr-placeholder="订单号码" ng-model="condition.orderNoLike">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>供货商代码</span>：</label>
                        <input type="text" class="form-control"  translate translate-attr-placeholder="供货商代码" ng-model="condition.supplierLike">
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"><span translate>创建时间</span>：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createdTimeStart"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="endDateShow=false;startDateShow=!startDateShow" is-open="startDateShow" close-text="关闭"
                               ng-change="checkDate(condition, 'createdTimeStart', 'createdTimeEnd')" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createdTimeEnd"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="startDateShow=false;endDateShow=!endDateShow" is-open="endDateShow" close-text="关闭"
                               ng-change="checkDate(condition, 'createdTimeStart', 'createdTimeEnd')" modal-size="small" readonly>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th class="border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.billFixedWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.curRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div class="font-0">
										<button class="btn btn-operate m-r-xs"
                                            ng-disabled="item.state == 2"
                                            ng-click="inbound(item)">入库</button>
                                        <button class="btn btn-operate m-r-xs"
                                            ng-disabled="item.state != 2"
                                            ng-click="generateFahuo(item)">生成发货单</button>
									</div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.curRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[1]" ng-if="activeFlag[1]">
            <hy-layout>
                <hy-layout-form>
                    <div class="m-t-sm form-up-tb clearfix">
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>转包单号</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.code || '-'}}">
                                {{orderObj.code || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>订单号码</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.orderNo || '-'}}">
                                {{orderObj.orderNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>供货商代码</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supplierNo || '-'}}">
                                {{orderObj.supplierNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>供货商名称</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supplierName || '-'}}">
                                {{orderObj.supplierName || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>出货地代码</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supPlaceNo  || '-'}}">
                                {{orderObj.supPlaceNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>要货工厂</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.factory || '-'}}">
                                {{orderObj.factory || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>创建时间</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.createdTime|YbDate:'yyyy-MM-dd HH:mm:ss') || '-'}}">
                                {{(orderObj.createdTime|YbDate:'yyyy-MM-dd HH:mm:ss') || '-'}}
                            </div>
                        </div>
                    </div>
                </hy-layout-form>
                <hy-layout-table>
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{detailTbConf.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in detailTbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(detailTbConf.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="detailTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.details.length > 0">
                        <table class="table-fixed border-none" width="{{detailTbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in orderObj.details track by $index">
                                <td class="spill-dots" ng-repeat="itemCol in detailTbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.details.length === 0" translate>暂时没有数据</div>
                </hy-layout-table>
                <hy-layout-footer>
                    <button type="button" class="btn btn-default m-r-sm" ng-click="cancel()" translate>返回</button>
                </hy-layout-footer>
            </hy-layout>
        </div>
        <div tab heading="入库" active="activeFlag[2]" ng-if="activeFlag[2]">
            <hy-layout>
                <hy-layout-form>
                    <form name="$parent.form" class="m-t-sm form-horizontal form-up-tb clearfix" novalidate>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>转包单号</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.code || '-'}}">
                                {{orderObj.code || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>订单号码</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.orderNo || '-'}}">
                                {{orderObj.orderNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>供货商代码</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supplierNo || '-'}}">
                                {{orderObj.supplierNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>供货商名称</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supplierName || '-'}}">
                                {{orderObj.supplierName || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>出货地代码</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.supPlaceNo  || '-'}}">
                                {{orderObj.supPlaceNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>要货工厂</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.factory || '-'}}">
                                {{orderObj.factory || "-"}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
                            <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>创建时间</span>：</label>
                            <div class="col-xs-8 wrapper-none spill-dots" title="{{(orderObj.createdTime|YbDate:'yyyy-MM-dd HH:mm:ss') || '-'}}">
                                {{(orderObj.createdTime|YbDate:'yyyy-MM-dd HH:mm:ss') || '-'}}
                            </div>
                        </div>
                        <div class="form-group col-xs-3 m-b-sm">
							<label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>仓库</span>：</label>
							<div class="col-xs-8 wrapper-none">
								<div yb-form-clear ng-model="orderObj.warehouseCode" select-obj="selectWarehouse()"
									 clear-form="clearWarehouse()" tips-name="仓库" form-require="true"></div>
		
								<div class="msg-block" ng-if="!orderObj.warehouseCode && submitted">
									<div class="error-msg">
										<div class="msg-triangle"></div>
										<span translate>请选择仓库</span>
									</div>
								</div>
							</div>
						</div>
                    </form>
                </hy-layout-form>
                <hy-layout-table>
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{detailTbConf.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in detailTbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(detailTbConf.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="detailTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.details.length > 0">
                        <table class="table-fixed border-none" width="{{detailTbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in orderObj.details track by $index">
                                <td class="spill-dots" ng-repeat="itemCol in detailTbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.details.length === 0" translate>暂时没有数据</div>
                </hy-layout-table>
                <hy-layout-footer>
                    <button type="button" class="btn btn-primary m-r-sm" ng-click="inboundSubmit(form.$valid)" translate>确认入库</button>
					<button type="button" class="btn btn-default" ng-click="cancel()" translate>取消</button>
                </hy-layout-footer>
            </hy-layout>
        </div>
    </div>
</div>